<?php
session_start();
include "../database.php";

$user_id = $_SESSION['id'];
if(isset($_GET['estimate']) && isset($_GET['current_round'])&&isset($_GET['story_id'])){
    $estimate = $_GET['estimate'];
    $current_round = $_GET['current_round'];
    $story_id = $_GET['story_id'];
    $query = "DELETE FROM planning_poker WHERE story_id = $story_id AND round = $current_round AND user_id = $user_id";
    executeQuery($query);
    $query = "INSERT INTO planning_poker (story_id, round, user_id, estimate) VALUES ('$story_id', '$current_round', '$user_id', '$estimate')";
    executeQuery($query);
}
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
